package abd.pr1.Interface;

import java.awt.BorderLayout;
import java.awt.event.ActionListener;
import java.awt.event.MouseListener;

import javax.swing.Icon;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class UserPanel extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JLabel nick;
	private JLabel imagen;
	private JLabel edad;

	public UserPanel() {

		super();
		this.build();

	}

	private void build() {

		this.setLayout(new BorderLayout());

		JPanel fotoPanel = new JPanel();
		JPanel datosPanel = new JPanel(new BorderLayout());

		nick = new JLabel();
		imagen = new JLabel();
		imagen.setSize(100, 100);
		edad = new JLabel();

		fotoPanel.add(imagen);

		datosPanel.add(nick, BorderLayout.NORTH);
		datosPanel.add(edad, BorderLayout.SOUTH);

		this.add(fotoPanel, BorderLayout.WEST);
		this.add(datosPanel, BorderLayout.CENTER);
	}

	public void setNick(String nickuser) {

		this.nick.setText(nickuser);
	}

	public void setImagen(Icon imagen) {

		this.imagen.setIcon(imagen);
	}

	public void setEdad(String edad) {

		this.edad.setText(edad);
	}
	
	public void addListener(MouseListener a){
		imagen.addMouseListener(a);
	}
}
